home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIURIChecker.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  162 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIURIChecker.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIURIChecker_h__
  6. #define __gen_nsIURIChecker_h__
  7.  
  8.  
  9. #ifndef __gen_nsIRequest_h__
  10. #include "nsIRequest.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURI; /* forward declaration */
  18.  
  19. class nsIChannel; /* forward declaration */
  20.  
  21. class nsIRequestObserver; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIURIChecker */
  25. #define NS_IURICHECKER_IID_STR "4660c1a1-be2d-4c78-9baf-c22984176c28"
  26.  
  27. #define NS_IURICHECKER_IID \
  28.   {0x4660c1a1, 0xbe2d, 0x4c78, \
  29.     { 0x9b, 0xaf, 0xc2, 0x29, 0x84, 0x17, 0x6c, 0x28 }}
  30.  
  31. /**
  32.  * nsIURIChecker
  33.  *
  34.  * The URI checker is a component that can be used to verify the existance
  35.  * of a resource at the location specified by a given URI.  It will use
  36.  * protocol specific methods to verify the URI (e.g., use of HEAD request
  37.  * for HTTP URIs).
  38.  */
  39. class NS_NO_VTABLE nsIURIChecker : public nsIRequest {
  40.  public: 
  41.  
  42.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURICHECKER_IID)
  43.  
  44.   /**
  45.      * Initializes the URI checker.  After this method is called, it is valid
  46.      * to further configure the URI checker by calling its nsIRequest methods.
  47.      * This method creates the channel that will be used to verify the URI.
  48.      * In the case of the HTTP protocol, only a HEAD request will be issued.
  49.      *
  50.      * @param aURI
  51.      *        The URI to be checked.
  52.      */
  53.   /* void init (in nsIURI aURI); */
  54.   NS_IMETHOD Init(nsIURI *aURI) = 0;
  55.  
  56.   /**
  57.      * Returns the base channel that will be used to verify the URI.
  58.      */
  59.   /* readonly attribute nsIChannel baseChannel; */
  60.   NS_IMETHOD GetBaseChannel(nsIChannel * *aBaseChannel) = 0;
  61.  
  62.   /**
  63.      * Begin asynchronous checking URI for validity.  Notification will be
  64.      * asynchronous through the nsIRequestObserver callback interface.  When
  65.      * OnStartRequest is fired, the baseChannel attribute will have been
  66.      * updated to reflect the final channel used (corresponding to any redirects
  67.      * that may have been followed).
  68.      *
  69.      * Our interpretations of the nsIRequestObserver status codes:
  70.      *   NS_BINDING_SUCCEEDED:   link is valid
  71.      *   NS_BINDING_FAILED:      link is invalid (gave an error)
  72.      *   NS_BINDING_ABORTED:     timed out, or cancelled
  73.      *
  74.      * @param aObserver
  75.      *        The object to notify when the link is verified.  We will
  76.      *        call aObserver.OnStartRequest followed immediately by
  77.      *        aObserver.OnStopRequest.  It is recommended that the caller use
  78.      *        OnStopRequest to act on the link's status.  The underlying request
  79.      *        will not be cancelled until after OnStopRequest has been called.
  80.      * @param aContext
  81.      *        A closure that will be passed back to the nsIRequestObserver
  82.      *        methods.
  83.      */
  84.   /* void asyncCheck (in nsIRequestObserver aObserver, in nsISupports aContext); */
  85.   NS_IMETHOD AsyncCheck(nsIRequestObserver *aObserver, nsISupports *aContext) = 0;
  86.  
  87. };
  88.  
  89. /* Use this macro when declaring classes that implement this interface. */
  90. #define NS_DECL_NSIURICHECKER \
  91.   NS_IMETHOD Init(nsIURI *aURI); \
  92.   NS_IMETHOD GetBaseChannel(nsIChannel * *aBaseChannel); \
  93.   NS_IMETHOD AsyncCheck(nsIRequestObserver *aObserver, nsISupports *aContext); 
  94.  
  95. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  96. #define NS_FORWARD_NSIURICHECKER(_to) \
  97.   NS_IMETHOD Init(nsIURI *aURI) { return _to Init(aURI); } \
  98.   NS_IMETHOD GetBaseChannel(nsIChannel * *aBaseChannel) { return _to GetBaseChannel(aBaseChannel); } \
  99.   NS_IMETHOD AsyncCheck(nsIRequestObserver *aObserver, nsISupports *aContext) { return _to AsyncCheck(aObserver, aContext); } 
  100.  
  101. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  102. #define NS_FORWARD_SAFE_NSIURICHECKER(_to) \
  103.   NS_IMETHOD Init(nsIURI *aURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aURI); } \
  104.   NS_IMETHOD GetBaseChannel(nsIChannel * *aBaseChannel) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseChannel(aBaseChannel); } \
  105.   NS_IMETHOD AsyncCheck(nsIRequestObserver *aObserver, nsISupports *aContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncCheck(aObserver, aContext); } 
  106.  
  107. #if 0
  108. /* Use the code below as a template for the implementation class for this interface. */
  109.  
  110. /* Header file */
  111. class nsURIChecker : public nsIURIChecker
  112. {
  113. public:
  114.   NS_DECL_ISUPPORTS
  115.   NS_DECL_NSIURICHECKER
  116.  
  117.   nsURIChecker();
  118.  
  119. private:
  120.   ~nsURIChecker();
  121.  
  122. protected:
  123.   /* additional members */
  124. };
  125.  
  126. /* Implementation file */
  127. NS_IMPL_ISUPPORTS1(nsURIChecker, nsIURIChecker)
  128.  
  129. nsURIChecker::nsURIChecker()
  130. {
  131.   /* member initializers and constructor code */
  132. }
  133.  
  134. nsURIChecker::~nsURIChecker()
  135. {
  136.   /* destructor code */
  137. }
  138.  
  139. /* void init (in nsIURI aURI); */
  140. NS_IMETHODIMP nsURIChecker::Init(nsIURI *aURI)
  141. {
  142.     return NS_ERROR_NOT_IMPLEMENTED;
  143. }
  144.  
  145. /* readonly attribute nsIChannel baseChannel; */
  146. NS_IMETHODIMP nsURIChecker::GetBaseChannel(nsIChannel * *aBaseChannel)
  147. {
  148.     return NS_ERROR_NOT_IMPLEMENTED;
  149. }
  150.  
  151. /* void asyncCheck (in nsIRequestObserver aObserver, in nsISupports aContext); */
  152. NS_IMETHODIMP nsURIChecker::AsyncCheck(nsIRequestObserver *aObserver, nsISupports *aContext)
  153. {
  154.     return NS_ERROR_NOT_IMPLEMENTED;
  155. }
  156.  
  157. /* End of implementation class template. */
  158. #endif
  159.  
  160.  
  161. #endif /* __gen_nsIURIChecker_h__ */
  162.